#include "ObjectFactory.h"
#include "BaseObject.h"

CObjectFactory::CObjectFactory()
{
	
}

CObjectFactory::~CObjectFactory()
{
	
}

void CObjectFactory::Initialize()
{
	m_pArrayBaseObjects = new CBaseObject[NUMBER_OF_BASE_OBJECTS];
	
}

void CObjectFactory::ShutDown()
{
	delete[] m_pArrayBaseObjects;
}

CBaseObject* CObjectFactory::GetBaseObject()
{
	for(unsigned int index=0; index < NUMBER_OF_BASE_OBJECTS; ++index)
	{
		if(m_pArrayBaseObjects[index].GetInUse())
			continue;
		else
		{
			m_pArrayBaseObjects[index].SetObject();
			m_pArrayBaseObjects[index].SetInUse(true);
			return &m_pArrayBaseObjects[index];
		}
	}

	return 0;

}

